Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: preserve cached config while mutating config #5735

Merged
merged 3 commits into from
Jun 26, 2024

Conversation

lukasholzer
Copy link
Contributor

🎉 Thanks for submitting a pull request! 🎉

Summary

Needed for: https://linear.app/netlify/issue/CT-738/cli-should-use-framework-detection-and-install-runtime-for-build-and

When a build plugin did config mutations, it did not preserve the previous configuration (cachedConfig). As it read it up freshly from the netlify.toml


For us to review and ship your PR efficiently, please perform the following steps:

  • Open a bug/issue before writing your code 🧑‍💻. This ensures
    we can discuss the changes and get feedback from everyone that should be involved. If you`re fixing a typo or
    something that`s on fire 🔥 (e.g. incident related), you can skip this step.
  • Read the contribution guidelines 📖. This ensures
    your code follows our style guide and passes our tests.
  • Update or add tests (if any source code was changed or added) 🧪
  • Update or add documentation (if features were changed or added) 📝
  • Make sure the status checks below are successful ✅

A picture of a cute animal (not mandatory, but encouraged)

Copy link
Contributor

This pull request adds or modifies JavaScript (.js, .cjs, .mjs) files.
Consider converting them to TypeScript.

Copy link
Member

@eduardoboucas eduardoboucas left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM. Tests are failing, though. Also, do you think it's worth putting this behind a feature flag?

@lukasholzer lukasholzer marked this pull request as draft June 26, 2024 15:26
@lukasholzer lukasholzer force-pushed the fix/preserve-cached-config-while-mutating-config branch from fbb9613 to 9347e75 Compare June 26, 2024 15:49
@lukasholzer
Copy link
Contributor Author

LGTM. Tests are failing, though. Also, do you think it's worth putting this behind a feature flag?

These area is so super well tested, that if all tests pass and I don't have to touch a snapshot I'm pretty confident with the changes that it does not break anything.

The currently solution works fine by passing down the cachedConfig to @netlify/config. It took just so long to test/build as I've forgotten it in one place and therefore the tests where failing. Now I'm pretty confident

@lukasholzer lukasholzer marked this pull request as ready for review June 26, 2024 15:55
@lukasholzer lukasholzer merged commit 260a8fb into main Jun 26, 2024
37 checks passed
@lukasholzer lukasholzer deleted the fix/preserve-cached-config-while-mutating-config branch June 26, 2024 16:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants